<template>
    <div>
        <!-- brand 图片 -->
         <van-nav-bar title="乐购" left-text="返回" left-arrow  @click-left="onClickLeft"/>
        <div class="brand">
                <img src="http://yanxuan.nosdn.127.net/1541445967645114dd75f6b0edc4762d.png" alt="">
                <p class="one">{{list.name}}</p>
                <p class="two">{{list.simple_desc}}</p>
        </div>
        <!-- 类似分类列表 -->
              <ul v-if="goodsList.length!=0">
                <li v-for="item in goodsList" :key="item.id">
                <img :src="item.list_pic_url" alt="">
                <p class="one">{{item.name}}</p>
                <P class="two">¥{{item.retail_price}}</P>
                </li>
            </ul>
            <p v-else class="false">数据库暂无数据...</p>
            
        </div>
    
</template>

<script>
    import {detailaction} from "@/api/home/brand"//一定要带黄括号!
    export default {
        data(){
            return {
                list:[],
                goodsList:""
                // 这里goodsList=res.data=list
            }
        },
        methods: {
            
          onClickLeft(){
              this.$router.go(-1)
          }
        },
        created() {
             detailaction({
                id: this.$route.query.id,
               
            }).then(res=>{
                console.log(res);
                this.list=res.data;
                this.goodsList=res.goodsList;
                //   console.log(this.list);
                // this.list=this.res.data
            })
        }
    }
</script>

<style lang="scss" scoped>
.brand{
    width: 100%;
    height: 210px;
     position: relative;
     margin-bottom: 30px;
   img{
       width: 100%;
       height: 145px;
   }
   .one{
    //    text-align: center;
       position: absolute;
       left: 50%;
       top: 50%;
       transform: translate(-50%,-50%);
      font-size: .50667rem;
      border-bottom: .06667rem solid #fff;
      color:#fff
   }
   .two{
       width: 80%;
        height: 86px;
        margin: 20px auto;
        font-size: .4rem;
        color: #666;
        text-align: center;
   }
}
 ul{
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        background-color: #fff;
        li{
            width: 186px;
            background-color: oldlace;
            margin-bottom: 5px;
            
           img{
               width: 151px;
               height: 151px;
               margin:5px;   
           }
           .one{
               font-size: 12px;
               color: slateblue;
           }
           .two{
               color: palevioletred;
               font-size: 18px;
           }

        }
 }
 .false{
     color: red;
     font-size: 16px;
 }
</style>